-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds user -> account linking #19
Conversation
tests/client-tests.js
Outdated
const hull = new Hull({ id: "562123b470df84b740000042", secret: "1234", organization: "test" }); | ||
|
||
const scoped = hull.asAccount({ id: "123456" }); | ||
const scoped = hull.asAccount({ name: "Hull" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Account lookup by name is not available at the moment.
We can only lookup using domain
or external_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okey, I've removed it from accountClaim properties and adjusted tests.
tests/client-tests.js
Outdated
.to.have.property("sub") | ||
.that.eql("123456"); | ||
.to.have.property("io.hull.asAccount") | ||
.that.eql({ name: "Hull" }); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could had a test for account traits without using asUser
to set the account name (or anything else), like this : hull.asAccount({ domain: 'hull.io' }).traits({ name: 'Hull' })
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have one test for hull.asAccount()
without user resolution. I would test traits
on other place, but thanks, for pointing it out.
tests/client-tests.js
Outdated
|
||
expect(scopedJwtClaims) | ||
.to.have.property("io.hull.subjectType") | ||
.that.eql("account"); | ||
expect(scopedJwtClaims) | ||
.to.have.property("io.hull.asAccount") | ||
.that.eql({ name: "Hull" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, name
is not available here
tests/client-tests.js
Outdated
}); | ||
|
||
it("should allow to link user to an existing account", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not actually linking. It is just a getter to the user's account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, fixed.
use asUser with id in token when subjectType is not a user
requestExtract
handler - allow passingpath
param.asUser()
and.asAccount()
to returntraits
andtrack
.asUser().account()
method